[PATCH 7/9] fix: Adjust min/max for 32f_s32f_convert_8i kernel
authorJohannes Demel <demel@ant.uni-bremen.de>
Mon, 15 Jun 2020 21:14:26 +0000 (23:14 +0200)
committerA. Maitland Bottoms <bottoms@debian.org>
Tue, 30 Jun 2020 23:48:20 +0000 (00:48 +0100)
This kernel used `CHAR_MIN` to determine the minimum value which may be
0. It is expected that this value is -127. Thus, we move to `INT8_MIN`.

Fix #390

Gbp-Pq: Name 0007-fix-Adjust-min-max-for-32f_s32f_convert_8i-kernel.patch

kernels/volk/volk_32f_s32f_convert_8i.h

index 242c3bd358d29a7d54c65fa83d4d1db991ca4d78..ea16ef8953aaab46ac7fd3b0039074d84668fb82 100644 (file)
@@ -78,8 +78,8 @@
 
 static inline void volk_32f_s32f_convert_8i_single(int8_t* out, const float in)
 {
-    float min_val = CHAR_MIN;
-    float max_val = CHAR_MAX;
+    float min_val = INT8_MIN;
+    float max_val = INT8_MAX;
     if (in > max_val) {
         *out = (int8_t)(max_val);
     } else if (in < min_val) {